package com.lmx.repoDomain.tmodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

/**
 * 用户扩展表
 */
@Entity
@Table(name = "ccd_user_extend")
@JsonApiResource(type = "userextend")
@Inheritance(strategy = InheritanceType.JOINED)
public class Userextend extends BaseEntity implements java.io.Serializable {
	private String code;//编码
	private Integer score;// 等级：评分
	private Integer taskNumber;// 任务数
	private Integer callNumber;// 呼叫数量
	private Integer workHour;// 客服经验（小时数）
	private Dicttype level;// 等级：金牌银牌。。。
	private Integer rate;// 信誉(好评率)
	private String remark;//备注

	@Column(name = "code")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "score")
	public Integer getScore() {
		return score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	@Column(name = "task_number")
	public Integer getTaskNumber() {
		return taskNumber;
	}

	public void setTaskNumber(Integer taskNumber) {
		this.taskNumber = taskNumber;
	}

	@Column(name = "call_number")
	public Integer getCallNumber() {
		return callNumber;
	}

	public void setCallNumber(Integer callNumber) {
		this.callNumber = callNumber;
	}

	@Column(name = "work_hour")
	public Integer getWorkHour() {
		return workHour;
	}

	public void setWorkHour(Integer workHour) {
		this.workHour = workHour;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "level_id",foreignKey = @ForeignKey(name = "null"))
	public Dicttype getLevel() {
		return level;
	}

	public void setLevel(Dicttype level) {
		this.level = level;
	}

	@Column(name = "rate")
	public Integer getRate() {
		return rate;
	}

	public void setRate(Integer rate) {
		this.rate = rate;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
}